package cn.kgm.makeGodV2.ruleEngine.area.scope;

import cn.kgm.makeGodV2.ruleEngine.area.AreaSite;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Version 1.8
 * @Author: Kappi
 * @Date: 2025-10-10 9:58
 * @Description: cn.kgm.makeGodV2.ruleEngine.area.scope.SquareScope
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SquareScope extends AreaScope {

    private AreaSite topLeft;

    private AreaSite bottomRight;

    @Override
    public boolean contains(AreaSite site) {
        return (site.getX() >= topLeft.getX() && site.getX() <= bottomRight.getX() && site.getY() >= topLeft.getY() && site.getY() <= bottomRight.getY());
    }
}
